package com.mini.cn.goods.servlet.ws.common;


import com.mini.cn.goods.io.netty.ws.info.FastPushMsg;
import com.mini.cn.goods.io.netty.ws.info.LCDataPacket;
import com.mini.cn.goods.servlet.ws.serializer.ISerializer;
import com.mini.cn.goods.servlet.ws.serializer.SerializerFactory;
import lombok.extern.slf4j.Slf4j;


/**
 * Created with IntelliJ IDEA.
 * User: fly
 * Date: 2020-02-11
 * Time: 3:43 下午
 */
@Slf4j
public class PushMessageFactory {

    public static LCDataPacket coverInToOuT(FastPushMsg message) {
        LCDataPacket lcDataPacket = new LCDataPacket();
        ISerializer serializer= SerializerFactory.INTANCE.getIntanceSerializer(ISerializer.JSON);
        lcDataPacket.content = serializer.serializeBytes(message);
        return lcDataPacket;
    }
}
